<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="./css/login_styles.css">
<script language="JavaScript"
	src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
<title>登录</title>
</head>
<body>

	<div class="htmleaf-container">
		<div class="wrapper">
			<div class="container">
				<h1>欢迎</h1>

				<form class="form" id="loginForm">
					<input required="required" type="text" placeholder="用户名"
						name="account" id="account" value=""> <input
						required="required" type="password" placeholder="密码"
						name="password" id="password">
					<button type="button" id="login-button">登录</button>
					</br> <a href="merchantRegist.html" class="regist">注册</a>
				</form>
			</div>


			<ul class="bg-bubbles">
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
			</ul>
		</div>
	</div>

</body>

<script type="text/javascript">
$("#login-button").click(function () {
    var account = document.getElementById("account").value;
    var password = document.getElementById("password").value;
    $.post("merchantLogin", {account: account, password: password},
            function (data) {
                if (data == "error") {
                    window.location.href = "error.html";
                } else if (data == "false") {
                    alert("账户或者密码错误");
                } else if (data == "1") {
                    window.location.href = "dishManager.html";
                } else if (data == "0") {
                    window.location.href = "uncheck.html";
                }
                else if (data == "-1") {
                    window.location.href = "notAllow.html";
                } else if (data == "-2") {
                    window.location.href = "black.html";
                }
            });

});
	

</script>
</html>
